﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Lamex.Common
{
   public class ListItem
    {
       public ListItem(string text, string value)
        {
            this.text = text;
            this.value = value;
        }

        /// <summary>
        /// 参数化构造CListItem对象
        /// </summary>
        /// <param name="text">显示的内容</param>
        public ListItem(string text)
        {
            this.text = text;
            this.value = text;
        }

        private string text;
        private string value;

        /// <summary>
        /// 显示内容
        /// </summary>
        [DataMember]
        public string Text
        {
            get { return text; }
            set { text = value; }
        }

        /// <summary>
        /// 实际值内容
        /// </summary>
        [DataMember]
        public string Value
        {
            get { return this.value; }
            set { this.value = value; }
        }

        /// <summary>
        /// 返回显示的内容
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return Text.ToString();
        }

        
    }
}
